package com.ylr.xxx.springsecuritytest.api;

import com.ylr.xxx.springsecuritytest.util.JWTUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @Description TODO
 * @Author 11
 * @Date 2021/3/3 14:15
 * @Version 1.0
 */
@RestController
public class HelloController {
    @GetMapping("/level1")
    public String hello() {
        return "hello";
    }
    @GetMapping("/level2")
    public String hello_vip() {
        return "hello_vip";
    }
    @GetMapping("/level3")
    public String hello_user() {
        return "hello_user";
    }
    @GetMapping("/")
    public String index() {
        return "hello_user";
    }

    @GetMapping("/code")
    public String code(@RequestParam String code) {
        String token = JWTUtils.createToken(code);
        return token;
    }

}